package com.example.hospital.api.controller.form;

import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.*;

/**
 * @author luojing
 * @date 2024/5/15 8:42
 */
@Data
public class InsertMisUserForm {
    @NotBlank(message = "name不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9\\u4e00-\\u9f5a]{2,20}$", message = "name内容不正确")
    private String name;

    @NotBlank(message = "sex不能为空")
    @Pattern(regexp = "^男$|^女$", message = "sex内容不正确")
    private String sex;

    @Pattern(regexp = "^1[1-9][0-9]{9}$", message = "tel内容不正确")
    private String tel;

    @Email
    @Length(max = 200, message = "email内容不正确")
    private String email;

//    @NotNull(message = "status不能为空")
//    @Range(min = 1, max = 3, message = "status不能为空")
//    private Byte status;

    @Pattern(regexp = "^[a-zA-Z0-9\\u4e00-\\u9f5a]{2,20}$", message = "job内容不正确")
    private String job;

    @NotBlank(message = "username不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{5,50}$", message = "username内容不正确")
    private String username;

    @NotBlank(message = "password不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{6,200}$", message = "password内容不正确")
    private String password;
}
